package cn.usts.edu.lesson01;

import java.awt.*;

public class TestFrame2 {
    public static void main(String[] args) {
        MyFrame myFrame01 = new MyFrame(100,100,200,200);
        MyFrame myFrame02 = new MyFrame(300,100,200,200);
        MyFrame myFrame03 = new MyFrame(500,100,200,200);
        MyFrame myFrame04 = new MyFrame(700,100,200,200);
    }
}

class MyFrame extends Frame{

    // 设置计数器
    static int id = 0;

    public MyFrame(int x,int y,int w, int h){
        super("MyFrame:"+(++id));
        // 设置位置,长宽
        setBounds(x,y,w,h);
        // 设置可见性
        setVisible(true);
        setBackground(Color.orange);
    }
}